package com.inepex.inechart.client.displayengine;

import com.google.gwt.user.client.ui.Widget;

public class LayerManager {
	
	protected LayerGroup defaultLayerGroup;
	protected int zIndexStart = 0; //TODO
	
	public LayerManager() {
		defaultLayerGroup = new LayerGroup(null);
	}
	
	public LayerGroup getDefaultLayerGroup() {
		return defaultLayerGroup;
	}

	public void updateOrder(){
		int actualZ = zIndexStart;
		for (Layer layer : defaultLayerGroup.getSortedChildren()) {
			for (Widget w : layer.getWidgets()) {
				w.getElement().getStyle().setZIndex(actualZ);
			}
			zIndexStart++;
		}
	}
}
